import request from '@/utils/request'

// 查询艺人管理列表
export function listActor(query) {
  return request({
    url: '/cinema/actor/list',
    method: 'get',
    params: query
  })
}

// 查询艺人管理详细
export function getActor(id) {
  return request({
    url: '/cinema/actor/' + id,
    method: 'get'
  })
}

// 新增艺人管理
export function addActor(data) {
  return request({
    url: '/cinema/actor',
    method: 'post',
    data: data
  })
}

// 修改艺人管理
export function updateActor(data) {
  return request({
    url: '/cinema/actor',
    method: 'put',
    data: data
  })
}

// 删除艺人管理
export function delActor(id) {
  return request({
    url: '/cinema/actor/' + id,
    method: 'delete'
  })
}
// 查询部门下拉树结构
export function deptTreeSelect() {
  return request({
    url: '/system/user/deptTree',
    method: 'get'
  })
}
// 用户头像上传
export function uploadAvatar(data) {
  return request({
    url: '/cinema/actor/uploadAvatar',
    method: 'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: data
  })
}
// 统计每个 nativeplace 的艺人数量
export function countActorsByNativeplace() {
  return request({
    url: '/cinema/actor/nativeplace/count',
    method: 'get'
  })
}
